package mapper

import (
	"GinShop/config"
	"GinShop/model"
)

type GoodMapper struct {
	*config.Orm
}

func NewGoodMapper() *GoodMapper {
	return &GoodMapper{config.DB}
}

//根据商家的id查询商户下所拥有的所有的食品数据
func (gd *GoodMapper) QueryFoods(shopId int64) []model.Goods {
	var goods []model.Goods
	gd.Where(" shop_id = ? ", shopId).Find(&goods)

	return goods

}
